<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - VectorField Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset-fonts/reset-fonts.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="../examples/css/demo.css"/>
<link rel="stylesheet" type="text/css" href="../examples/css/dpSyntaxHighlighter.css">

 </head>

 <body>

<h1>inputEx - VectorField Usage</h1>


<!-- Example 1 -->
<div class='exampleDiv'>

	<h2>Basic VectorField creation</h2>
	
	<p>Use the following code to create a basic inputEx VectorField.</p>

	<div class='demoContainer' id='container1'></div>

	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			var field = new inputEx.VectorField({parentEl: 'container1', value: [-10.4,13*2]});

			var el = YAHOO.util.Dom.get('container1');

			var button1 = inputEx.cn('button', null, null, "SetValue");
			el.appendChild(button1);
			YAHOO.util.Event.addListener(button1, "click" ,function() {
			   field.setValue([-42.42,12.603]);
			});

			var logDiv = inputEx.cn('div', null, null, "Log :");
			el.appendChild(logDiv);
			field.updatedEvt.subscribe(function(e,params) {
				var value = params[0];
				logDiv.innerHTML += "Updated at "+(new Date())+" with value "+value;
				logDiv.appendChild(inputEx.cn('br'));
			});
		</textarea>
	</div>

</div>


<!-- Example 2 -->
<div class='exampleDiv'>

	<h2>VectorField with separators</h2>
	
	<p>VectorField inherits CombineField, so you can change the separators :</p>

	<div class='demoContainer' id='container2'></div>

	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			new inputEx.VectorField({
				parentEl: 'container2', 
				value: [-10.4,13*2],
				separators: ["x:",", y:", null]
			});
		</textarea>
	</div>

</div>


<!-- Example 3 -->
<div class='exampleDiv'>

	<h2>VectorField dimension</h2>
	
	<p>Set the dimension option :</p>

	<div class='demoContainer' id='container3'></div>

	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			new inputEx.VectorField({
				parentEl: 'container3', 
				value: [-1, 0, 1],
				dimension: 3,
				separators: ["x:",", y:", ", z: ", null]
			});
		</textarea>
	</div>

</div>


<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="../lib/yui/container/container-min.js"></script>

<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/Group.js"  type='text/javascript'></script>
<script src="../js/fields/StringField.js"  type='text/javascript'></script>
<script src="../js/fields/NumberField.js"  type='text/javascript'></script>
<script src="../js/fields/CombineField.js"  type='text/javascript'></script>
<script src="../js/fields/VectorField.js"  type='text/javascript'></script>

<!-- inputEx examples -->
<script src="js/dpSyntaxHighlighter.js"></script>
<script src="inputex-examples.js"></script>

 </body>
</html>